<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/inc/taglibs.jsp"%>
<script type="text/javascript">
$("#create").click(function(){
	$("#create").attr("disabled", "disabled");
	createJs();
});
function createJs() {
	$.ajax({
		type : "get",
		async : false,
		url : "${path}/admin/areaInfo/createJs.json",
		dataType : 'json',
		contentType : 'application/x-www-form-urlencoded',
		scriptCharset : 'utf-8',
		success : function(json) {
			if(json) {
				$("#create").removeAttr("disabled");
				alert(json.response.tip);
			}
		}
	});
}
</script>
<form id="pagerForm" method="post" action="${path }/admin/areaInfo">
	<input type="hidden" name="pageNum" value="${pageTurn.page }" />
	<input type="hidden" name="numPerPage" value="${pageTurn.pageSize }" />
	<input type="hidden" name="eqAreaId" value="${eqAreaId }" />
	<input type="hidden" name="eqProvince" value="${eqProvince }" />
	<input type="hidden" name="eqCity" value="${eqCity }" />
	<input type="hidden" name="eqDistrict" value="${eqDistrict }" />
	<input type="hidden" name="rel" value="${rel }" />
</form>

<div class="pageHeader">
	<form rel="pagerForm" onsubmit="return navTabSearch(this);" action="${path }/admin/areaInfo" method="post">
	<div class="searchBar">
		<table class="searchContent">
			<tr>
				<td>
					行政编码：
				</td>
				<td>
					<input type="text" size="15" name="eqAreaId" value="${eqAreaId }"/>
				</td>
				<td>
					省份：
				</td>
				<td>
					<input type="text" size="15" name="eqProvince" value="${eqProvince }"/>
				</td>
				<td>
					城市：
				</td>
				<td>
					<input type="text" size="15" name="eqCity" value="${eqCity }"/>
				</td>
				<td>
					地区：
				</td>
				<td>
					<input type="text" size="15" name="eqDistrict" value="${eqDistrict }"/>
				</td>
				<td>
					<div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div>
				</td>
				<td>
					<div class="buttonActive"><div class="buttonContent"><button id="create" type="button">生成地区js</button></div></div>
				</td>
			</tr>
		</table>
	</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li><a class="add" href="${path }/admin/areaInfo/edit.do?rel=${rel}" rel="${rel}" target="dialog" width="610" height="550"><span>添加</span></a></li>
			<li><a class="delete" href="${path }/admin/areaInfo/delete.do?rel=${rel}" target="selectedTodo" rel="inIdList" title="确定删除?"><span>删除</span></a></li>
			<li class="line">line</li>
		</ul>

	</div>
		<table class="table" width="100%" layoutH="130%">
            <thead>
			<tr>
				<th>ID<label style="float:left"><input type="checkbox" class="checkboxCtrl" group="inIdList" /></label></th>
				<th>省份</th>
				<th>城市</th>
				<th>地区</th>
				<th>详细地址</th>
				<th>街道</th>
				<th>邮政编码</th>
				<th>行政编码</th>
				<th width="120">操作</th>
			</tr>
			</thead>
		  <tbody> 
		  			<c:choose>
						<c:when test="${null==areaInfoList||areaInfoList.isEmpty()}">
							<tr class="tatr2">
								<td colspan="5" align="center">暂无数据</td>
							</tr>
						</c:when>
						<c:otherwise>
							<c:forEach items="${areaInfoList}" var="o">
								<tr target="id" rel="${o.id}">
								<td>
									<input type="checkbox" name="inIdList" id="inIdList" value="${o.id}"/>${o.id}
								</td>
								<td>${o.province}</td>
								<td>${o.city}</td>
								<td>${o.district}</td>
								<td>${o.address}</td>
								<td>${o.street}</td>
								<td>${o.postNumber}</td>
								<td>${o.areaId}</td>
								<td><a title="修改" target="dialog" href="${path}/admin/areaInfo/edit?id=${o.id}&rel=${rel}" rel="${rel}"  width="610" height="550"><span>修改</span></a>&nbsp;
								</td>
								</tr>
							</c:forEach>
						</c:otherwise>
					</c:choose>
		</tbody>
	</table>
	<div style="clear:both"></div>
    <div class="panelBar">
        <%@ include file="/inc/admin_pagination.jsp" %>
    </div>
</div>

